package cn.smxy.ln.controller;

import cn.smxy.ln.common.lang.Result;
import cn.smxy.ln.pojo.AdminType;
import cn.smxy.ln.service.AdminTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author ln
 * @date 2022年05月24日 19:52
 */
@RestController
@RequestMapping("/admintype/consumer")
public class AdminTypeController {

    @Autowired
    AdminTypeService adminTypeService;

    @GetMapping("/list")
    public Result queryAll() {
        return Result.succ(adminTypeService.queryAll());
    }

    @PostMapping("/save")
    public Result save(@RequestBody AdminType adminType) {
        return Result.succ(adminTypeService.save(adminType));
    }

    @PostMapping("/delete")
    public Result delete(@RequestParam(value = "id") Long id) {
        return Result.succ(adminTypeService.delete(id));
    }

    @PostMapping("/update")
    public Result update(@RequestBody AdminType adminType) {
        return Result.succ(adminTypeService.update(adminType));
    }
}
